import axios from '../AxiosConfig.js'

export const createAccount = data => {
  return axios({
    method: 'post',
    url: '/api/account',
    data: data
  })
}

export const deleteAccount = ukId => {
  return axios({
    method: 'delete',
    url: '/api/account/' + ukId,
    params: {}
  })
}

export const updateAccount = data => {
  return axios({
    method: 'put',
    url: '/api/account',
    data: data
  })
}

export const listAccountByOrgUkId = orgUkId => {
  return axios({
    method: 'get',
    url: '/api/account/org',
    params: {"orgUkId": orgUkId}
  })
}

export const listAccount = (username) => {
  return axios({
    method: 'get',
    url: '/api/account/list',
    params: {"username": username}
  })
}





export const listAccountByRoleId = bId => {
  return axios({
    method: 'get',
    url: '/api/manage/account/list/role/' + bId,
    params: {}
  })
}


export const saveAccount = data => {
  return axios({
    method: 'post',
    url: '/api/manage/account/save',
    data: data
  })
}

export const updateAccountStatus = (accountId, status) => {
  return axios({
    method: 'get',
    url: '/api/manage/account/' + accountId + '/status/' + status,
    params: {}
  })
}

export const updateAccountPassword = data => {
  return axios({
    method: 'post',
    url: '/api/manage/account/update/password',
    data: data
  })
}

export const resetAccountPassword = data => {
  return axios({
    method: 'post',
    url: '/api/manage/account/reset/password',
    data: data
  })
}
